package com.course.utils;

import com.course.model.InterfaceName;

import java.util.Locale;
import java.util.ResourceBundle;

/**
 * @author bigFish
 * @Title: public:
 */
public class ConfigFile {
    private static ResourceBundle bundle = ResourceBundle.getBundle("application", Locale.CHINA);

    public static String getUrl(InterfaceName name) {
        String address = "http://127.0.0.1:8097";
        String base = "/user";
        address += base;
        String uri = "";
        if (name == InterfaceName.GETINFO) {
            uri = "/getInfo";
        }
        if (name == InterfaceName.ADDUSER) {
//            uri = bundle.getString("add");
            uri = "/add";
        }
        if (name == InterfaceName.GETUSERLIST) {
//            uri = bundle.getString("getList");
            uri = "/getList";
        }
        if (name == InterfaceName.LOGIN) {
//            uri = bundle.getString("login");
            uri = "/login";
        }
        if (name == InterfaceName.UPUSER) {
//            uri = bundle.getString("update");
            uri = "/update";
        }
        String url = address + uri;
        return url;
    }
}
